package com.baitiaojun.system.admin.mapper.config;

import com.baitiaojun.common.enums.impl.TenantStatusEnums;
import com.baitiaojun.common.utils.string.StringUtils;
import com.baitiaojun.system.admin.pojo.DbConfigDO;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;

/**
* @author baitiaojun
* @description 针对表【db_config】的数据库操作Mapper
* @createDate 2024-09-17 15:22:14
* @Entity generator.domain.DbConfig
*/
public interface DbConfigMapper extends BaseMapper<DbConfigDO> {

    default DbConfigDO selectOne(String configName) {
        LambdaQueryWrapper<DbConfigDO> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(StringUtils.isNotEmpty(configName), DbConfigDO::getName, configName)
                .eq(DbConfigDO::getStatus, TenantStatusEnums.NORMAL.getCode());
        return selectOne(queryWrapper);
    }
}




